Structured light active sensing systems transmit and receive patterns corresponding to spatial codes (codewords), to generate a depth map for a scene. The farther away an object is from the transmitter and receiver, the closer the received spatial code projection is from its original position at the receiver(s), as the outgoing spatial code projection and reflected incoming spatial code projection are more parallel. Conversely, the closer an object is to the transmitter and receiver, the farther the received spatial code projection is from its original position at the receiver(s). Thus, the difference between a received and a transmitted codeword position indicates the depth of an object in the scene. Structured light active sensing systems use these relative depths to generate a depth map, or a three dimensional representation of a scene. Depth maps are critical to many applications ranging from camera quality enhancement to computer vision.
Each codeword may be encoded using light patterns segmented into rows and columns with varying intensity values. For example, bright and dark intensity values may be used to represent 0's and 1's to form a binary pattern. Other spatial codes may use more than two different intensity values.
Interference, such as speckle may cause the received spatial codes and resultant depth maps to have gaps or holes. For example, interference present when a binary code is transmitted may cause an encoded “1” value in the transmitted code to be received as a “0”, or vice versa. Thus, the received spatial code won't be recognized as the spatial code that was transmitted. This resulting error may result in incorrect or missing depth values in a depth map of the scene.